package org.yjhking.feignclient;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.yjhking.domain.User;
import org.yjhking.query.AjaxResult;

@FeignClient(value = "user-server", fallbackFactory = UserFeignClientFallbackFactory.class) // 指定需要调用的服务的应用名称
public interface UserFeignClient {
    @GetMapping("/{id}")
    public AjaxResult getUserById(@PathVariable Long id);
    
    @PostMapping("/updateUser")
    public AjaxResult updateUser(@RequestBody User user);
}